import request from "@/utils/request";

/**
 * 部门列表
 * @returns {Promise<any>}
 */
export async function getPermissionList() {
  return request('/admin/permissions')
}

/**
 * 添加权限
 * @param params
 * @returns {Promise<any>}
 */
export async function addPermission(params) {
  return request.post('/admin/permissions', {params})
}

/**
 * 权限详情
 * @returns {Promise<any>}
 * @param permissionId
 */
export async function showPermission(permissionId) {
  return request(`/admin/permissions/${permissionId}`)
}

/**
 * 编辑权限
 * @returns {Promise<any>}
 * @param permissionId
 * @param params
 */
export async function updatePermission(permissionId,params) {
  return request.put(`/admin/permissions/${permissionId}`,{params})
}
